package com.quan.mall.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;


/**
 * <p>
 * 电商-商品规格属性表
 * </p>
 *
 * @author 杨浩泉
 * @since 2018-11-10
 */
@Table(name = "tb_mall_goods_spec_attr")
public class MallGoodsSpecAttr implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	/**
	 * 商品分类ID
	 */
	@Column(name = "category_id")
	private Long categoryId;

	/**
	 * 商品分类IDS（cascader路径）
	 */
	@Column(name = "category_ids")
	private String categoryIds;

	/**
	 * 品牌ID
	 */
	@Column(name = "brand_id")
	private Long brandId;

	/**
	 * 类型ID
	 */
	@Column(name = "type_id")
	private Long typeId;

	/**
	 * 商品规格属性
	 */
	private String name;

	/**
	 * 排序
	 */
	private Integer sort;

	/**
	 * 创建时间
	 */
	private Date ctime;

	/**
	 * 最后更新时间
	 */
	private Date utime;

	/**
	 * 关联分类
	 */
	@Transient
	private MallGoodsCategory category ;
	
	/**
	 * 关联品牌
	 */
	@Transient
	private MallGoodsBrand brand ;
	
	/**
	 * 关联类型
	 */
	@Transient
	private MallGoodsType type ;
	

	/**
	 * 规格值
	 */
	@Transient
	private List<MallGoodsSpecValue> values ;
	
	public MallGoodsCategory getCategory() {
		return category;
	}

	public void setCategory(MallGoodsCategory category) {
		this.category = category;
	}

	public MallGoodsBrand getBrand() {
		return brand;
	}

	public void setBrand(MallGoodsBrand brand) {
		this.brand = brand;
	}

	public MallGoodsType getType() {
		return type;
	}

	public void setType(MallGoodsType type) {
		this.type = type;
	}

	public List<MallGoodsSpecValue> getValues() {
		return values;
	}

	public void setValues(List<MallGoodsSpecValue> values) {
		this.values = values;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	/**
	 * 获取ID
	 */
	public Long getId() {
		return id;
	}
	
	/**
	 * 设置ID
	 */
	public void setId(Long id) {
		this.id = id;
	}
			
	/**
	 * 获取商品分类ID
	 */
	public Long getCategoryId() {
		return categoryId;
	}
	
	/**
	 * 设置商品分类ID
	 */
	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}
			
	/**
	 * 获取商品分类IDS（cascader路径）
	 */
	public String getCategoryIds() {
		return categoryIds;
	}
	
	/**
	 * 设置商品分类IDS（cascader路径）
	 */
	public void setCategoryIds(String categoryIds) {
		this.categoryIds = categoryIds;
	}
			
	/**
	 * 获取品牌ID
	 */
	public Long getBrandId() {
		return brandId;
	}
	
	/**
	 * 设置品牌ID
	 */
	public void setBrandId(Long brandId) {
		this.brandId = brandId;
	}
			
	/**
	 * 获取类型ID
	 */
	public Long getTypeId() {
		return typeId;
	}
	
	/**
	 * 设置类型ID
	 */
	public void setTypeId(Long typeId) {
		this.typeId = typeId;
	}
			
	/**
	 * 获取商品规格属性
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * 设置商品规格属性
	 */
	public void setName(String name) {
		this.name = name;
	}
			
	/**
	 * 获取排序
	 */
	public Integer getSort() {
		return sort;
	}
	
	/**
	 * 设置排序
	 */
	public void setSort(Integer sort) {
		this.sort = sort;
	}
			
	/**
	 * 获取创建时间
	 */
	public Date getCtime() {
		return ctime;
	}
	
	/**
	 * 设置创建时间
	 */
	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}
			
	/**
	 * 获取最后更新时间
	 */
	public Date getUtime() {
		return utime;
	}
	
	/**
	 * 设置最后更新时间
	 */
	public void setUtime(Date utime) {
		this.utime = utime;
	}

	@Override
	public String toString() {
    	return "UpmsUser{" +
        	"id=" + id +
	            	", categoryId=" + categoryId +
	            	", categoryIds=" + categoryIds +
	            	", brandId=" + brandId +
	            	", typeId=" + typeId +
	            	", name=" + name +
	            	", sort=" + sort +
	            	", ctime=" + ctime +
	            	", utime=" + utime +
	        "}";
	}

}
